import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { NewsService } from '../../service/news.service';
import { Router, ActivatedRoute } from '@angular/router';
import { CarouselService } from '../../service/carousel.service';
import { Carousel } from '../../model/carousel';

@Component({
  selector: 'app-upload',
  templateUrl: './upload.component.html',
  styleUrls: ['./upload.component.css']
})
export class UploadComponent implements OnInit {

   cl:Array<Carousel>;
  constructor(private http:HttpClient,
    private routerinfo:ActivatedRoute,
 private router:Router,
 private carouselservice:CarouselService
    ) { 

this.cl=new Array();

    }

  ngOnInit() {

this.carouselservice.getCarouselList()
.then((data:any)=>{

this.cl=data;

})


  }









  addCarousel(){
this.router.navigate(['eidtCarousel','add']);


  }

}
